N = int(input())
X = int(input())
Y = int(input())
T = int(input())
num = N
S = num
for i in range(2,Y):
        num = num*(X+1)

for i in range(Y,T+1):
        # Y 天之前的感染人数
        num = (num - S)*(X+1)
        S = S*X
print(num)
        
